#ifndef PLUGIN_MANAGER_H
#define PLUGIN_MANAGER_H

#include <QObject>
#include <QDir>
#include <QPluginLoader>
#include <QList>
#include "core/plugin/plugin_interface.h"

class MainWindow;

class PluginManager : public QObject {
    Q_OBJECT
    
public:
    explicit PluginManager(MainWindow *mainWindow, QObject *parent = nullptr);
    ~PluginManager();
    
    void loadPlugins();
    void unloadPlugins();
    
    QList<PluginInterface*> plugins() const;
    
private:
    void loadPlugin(const QString &filePath);
    
    MainWindow *m_mainWindow;
    QList<QPluginLoader*> m_pluginLoaders;
    QList<PluginInterface*> m_plugins;
};

#endif // PLUGIN_MANAGER_H